BINDIR=build

.PHONY: all debug release bdebug brelease builddir clean package

all: release

debug: builddir bdebug package

release: builddir brelease package

bdebug:
	cd ${BINDIR} && cmake -DCMAKE_BUILD_TYPE=Debug .. && make

brelease:
	cd ${BINDIR} && cmake -DCMAKE_BUILD_TYPE=Release .. && make

builddir:
	mkdir -p ${BINDIR}

clean:
	rm -fr ${BINDIR}

package:
	cd ${BINDIR} && rm -fr CMake* cmake_* Makefile cmake
	mkdir -p ${BINDIR}/conf
	cp -fr conf/* ${BINDIR}/conf
